package exam.test15;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Endstart
 * Date: 2020-12-12
 * Time: 11:13
 */
import java.util.ArrayList;
public class ClassList {

    private ArrayList<Enrolment> students=null;

    public ClassList() {
        students = new ArrayList<Enrolment>();
    }

    public void addStudent(String _name, String _classType) {
        Enrolment e = new Enrolment(_name, _classType);
        students.add(e);
    }

    public String toString() {
        String finalString = "";
        String aStuString = "";
        for (Enrolment e: students) {
            aStuString = e.classType + " " + e.name + "\n"; finalString =                       finalString + aStuString;
        }
        return finalString;
    }
}
